
<div class="game-main">
  <div id="bet-game">
  <div class="beet-box-bg" style="display: none;width:100%;height:100%;position: fixed;top: 0;left: 0;z-index:99">
  <div class="beet-tips"> 
     <?php
		if($_COOKIE['mode']){
			$mode=$_COOKIE['mode'];
		}else{
			$mode=2.00;
		}
		$this->getSystemSettings();
		$this->getTypes();
		$sql="select id, groupName, enable from {$this->prename}played_group where enable=1 and type=? order by sort";
		$groups=$this->getObject($sql, 'id', $this->types[$this->type]['type']);
		if($this->groupId && !$groups[$this->groupId]) unset($this->groupId);
	
		if($groups) foreach($groups as $key=>$group){
			if($this->groupId==$group['id']){
			echo '<div style="margin-bottom:1em;"><div class="beet-tips-tit"><span id="play_title">'.$group['groupName'].'</span></div></div>';
			}
		}
	?>
	<div class="clear"></div>
    <div class="game-btn">

	<?php
		if($groups) foreach($groups as $key=>$group){
			if(!$this->groupId) $this->groupId=$group['id'];
	?>
      <div class="ul-li<?=($this->groupId==$group['id'])?' current':''?>"> <a class="cai" href="/index.php/index/group/<?=$this->type .'/'.$group['id']?>"><span class="contentXXXX">
        <?=$group['groupName']?>
        </span></a> </div>
      <?php } ?>
	  
		<div class="clear"></div>
    </div>
	
	<!--inc_game_played S-->
	<?php
		$sql="select groupName from {$this->prename}played_group where id=?";
		$groupName=$this->getValue($sql, $this->groupId);

		$sql="select id, name, playedTpl, enable  from {$this->prename}played where enable=1 and groupId=? order by sort";
		$playeds=$this->getRows($sql, $this->groupId);
		if(!$playeds) {echo '<div style="height:150px;margin-top:50px;text-align:center;color:#f00">暂无玩法</div>';return;} 
		if(!$this->played) $this->played=$playeds[0]['id'];
		
		if($playeds) foreach($playeds as $played){
			if($played['id']==$this->played){
				echo '<div style="margin-bottom:2em;"><div class="beet-tips-tit"><span id="play_title2">'.$played['name'].'</span></div></div>';
			}
		}
		
	?>
	    <div class="game-cont">
			<div class="game-btn2">
				<?php
					if($playeds) foreach($playeds as $played){
						if($this->played==$played['id']){
							$tpl=$played['playedTpl'];
						}
						if($played['enable']){
				?>
				<div class="ul-li<?=($played['id']==$this->played)?' current':''?>"><a data_id="<?=$played['id']?>" href="/index.php/index/played/<?=$this->type?>/<?=$played['id']?>"><?=$played['name']?></a></div>
				<? }} ?>
				<div class="clear"></div>
			</div>
		</div>
	</div>
	</div><!--beet-box-bg end-->
	<!--inc_game_played E-->
    <div class="game-cont">
	
	<!--inc_game_played S-->
	
<?php if($this->type!=30){?>
	<div id="game-helptips"><?php $this->display("index/inc_game_tips.php", 0 ,$this->played); ?></div>
<?php } ?>	
	<div class="num-table" id="num-select">
	<?php 
		if(!$played['enable']) {echo '<div style="height:100px;text-align:center;color:#f00">暂无玩法</div>';return;} 
		
		$this->display("index/game-played/$tpl.php"); ?>
	</div>
	<!--inc_game_played E-->

	
      <?php //$this->display('index/inc_game_played.php'); ?>
	  

	  <div id="touzhuBox" style="display:none;">
	  <!--投注区域开始-->
      <div class="num-table" id="game-dom" style="height:auto;">
        <div class="fandian">
          <div class="fandian-k"> <span class="spn8">奖金/返点：<span id="fandian-value" style="float:right;" class="fdmoney">
            <?=$maxPl?>
            /0%</span></span>
				<div class="fandian-box">
				  <input type="button" class="min" value="-" step="-0.1"/>
				  <div id="slider" class="slider" value="<?=$this->ifs($_COOKIE['fanDian'], 0)?>" data-bet-count="<?=$this->settings['betMaxCount']?>" data-bet-zj-amount="<?=$this->settings['betMaxZjAmount']?>" max="<?=$this->user['fanDian']?>" game-fan-dian="<?=$this->settings['fanDianMax']?>" fan-dian="<?=$this->user['fanDian']?>" game-fan-dian-bdw="<?=$this->settings['fanDianBdwMax']?>" fan-dian-bdw="<?=$this->user['fanDianBdw']?>" min="0" step="0.1" slideCallBack="gameSetFanDian"></div>
				  <input type="button" class="max" value="+" step="0.1"/>
				</div>
             </div>
          <div class="danwei"> <span class="spn8">模式：</span>
            <label class="checked22">元
              <input type="radio" value="2.00" data-max-fan-dian="<?=$this->settings['betModeMaxFanDian0']?>" name="danwei" <?=$this->iff($mode=='2.00','checked')?> />
            </label>
            <label style="border-left:0;border-right:0;">角
              <input type="radio" value="0.20" data-max-fan-dian="<?=$this->settings['betModeMaxFanDian1']?>" name="danwei" <?=$this->iff($mode=='0.20','checked')?> />
            </label>
            <?php if($this->settings['fenmosi']==1){?>
            <label>分
              <input type="radio" value="0.02" data-max-fan-dian="<?=$this->settings['betModeMaxFanDian2']?>" name="danwei" <?=$this->iff($mode=='0.02','checked')?> />
            </label>
            <?}?>
          </div>
          <div class="beishu"> <span class="spn8">倍数：</span>
            <input type="button" class="surbeishu" value="-"/>
            <input id="beishu" type="text" value="<?=$this->ifs($_COOKIE['beishu'],1)?>" class="txt"/>
            <input type="button" class="addbeishu" value="+"/>
          </div>
          <div class="tztj-btn" style="display:none;">
            <div class="tztj-hover" onclick="gameActionAddCode()"></div>
          </div>
        </div>
      </div>
	  <!--投注区域结束-->
	  </div>
	  
	  
	  <!--
	  <div class="num-table" id="game-dom" style="height:auto;">
        <div class="fandian">
          <div class="fandian-k"> <span class="spn8">奖金/返点：</span>
            <div class="fandian-box">
              <input type="button" class="min" value="" step="-0.1"/>
              <div id="slider" class="slider" value="<?=$this->ifs($_COOKIE['fanDian'], 0)?>" data-bet-count="<?=$this->settings['betMaxCount']?>" data-bet-zj-amount="<?=$this->settings['betMaxZjAmount']?>" max="<?=$this->user['fanDian']?>" game-fan-dian="<?=$this->settings['fanDianMax']?>" fan-dian="<?=$this->user['fanDian']?>" game-fan-dian-bdw="<?=$this->settings['fanDianBdwMax']?>" fan-dian-bdw="<?=$this->user['fanDianBdw']?>" min="0" step="0.1" slideCallBack="gameSetFanDian"></div>
              <input type="button" class="max" value="" step="0.1"/>
            </div>
            <span id="fandian-value" class="fdmoney">
            <?=$maxPl?>
            /0%</span> </div>
          <div class="danwei"> <span class="spn8">模式：</span>
            <label>元
              <input type="radio" value="2.00" data-max-fan-dian="<?=$this->settings['betModeMaxFanDian0']?>" name="danwei" <?=$this->iff($mode=='2.00','checked')?> />
            </label>
            <label>角
              <input type="radio" value="0.20" data-max-fan-dian="<?=$this->settings['betModeMaxFanDian1']?>" name="danwei" <?=$this->iff($mode=='0.20','checked')?> />
            </label>
            <?php if($this->settings['fenmosi']==1){?>
            <label>分
              <input type="radio" value="0.02" data-max-fan-dian="<?=$this->settings['betModeMaxFanDian2']?>" name="danwei" <?=$this->iff($mode=='0.02','checked')?> />
            </label>
            <?}?>
          </div>
          <div class="beishu"> <span class="spn8">倍数：</span>
            <input type="button" class="surbeishu" value="-"/>
            <input id="beishu" value="<?=$this->ifs($_COOKIE['beishu'],1)?>" class="txt"/>
            <input type="button" class="addbeishu" value="+"/>
          </div>
          <div class="tztj-btn">
            <div class="tztj-hover" onclick="gameActionAddCode()"></div>
          </div>
        </div>
      </div>
	  -->
	  
      <div class="line"></div>
      <div class="touzhu" style="display:none;">
        <div class="touzhu-top"> 
          <!--<button class="tz-top-btn" onclick="gameActionRandom(1)">机选一注</button>
				<button class="tz-top-btn" onclick="gameActionRandom(5)" >机选五注</button>-->
          <div class="prompt" id="game-tip-dom"></div>
          <button class="tz-top-btn" onclick="gameActionRemoveCode()">清空号码</button>
          <div class="clear"></div>
        </div>
        <!--<select size="7" class="touzhu-cont" id="select-code" ></select>-->
        <div class="line"></div>
        <div class="touzhu-cont">
          <table width="100%">
          </table>
        </div>
        <div class="line"></div>
        <div class="touzhu-bottom">
          <div class="tz-tongji">总投注数：<span id="all-count">0</span>注&nbsp;&nbsp;&nbsp;&nbsp;购买金额：<span id="all-amount">0.00</span>元</div>
          <div class="tz-buytype" style="display:none">
            <?php if($this->types[$this->type]['type']==8){?>
            <!--<label><input type="checkbox" value="1"  name="fpEnable" />&nbsp;快乐飞盘&nbsp;</label>-->
            <?php } ?>
            <!--<label><input type="checkbox" name="qzEnable" value="1" <?//=$this->iff($this->settings['switchMaster'],'checked="checked"')?>/>&nbsp;庄内庄&nbsp;</label>-->
            <label class="zh-true-btn">
              <input type="checkbox" name="zhuiHao" value="1" />
            </label>
            <div class="tz-true-btn">
              <div class="tz-true-hover" id="btnPostBet">确定投注</div>
            </div>
          </div>
        </div>
      </div>
	  
      <?php if($this->settings['tzjl']==1){?>
      <div class="touzhu-true">
        <table width="100%">
          <thead>
           					<tr>
						<td>单号</td>
						<td>彩种</td>
						<td>玩法</td>
						<td>期号</td>
                        <td>金额</td>
						<td>操作</td>
					</tr>
          </thead>
          <tbody id="order-history">
            <?php $this->display('index/inc_game_order_history.php'); ?>
          </tbody>
        </table>
      </div>
      <?}?>
    </div>
  </div>
  <div id="znz-game" style="display:none;"></div>
</div>



<script type="text/javascript">

	$(function(){
		
		domAction();
		
		$('.ui-betting-title').bind('touchend', function () {
			event.preventDefault();
			
			$('.beet-box-bg').toggle();
			$('.beet-rig').hide();
		});
		

		$('.bett-head').click(function(){
			$('.beet-box-bg').hide();
			$('.beet-rig').toggle();
			return false;
		});
		
		$('.beet-box-bg').bind("click",function(e){
			//console.log($(this).css('display'));
			if($(this).css('display')!='none'){
				//event.stopPropagation();
				
			}
			if($(e.target).attr("class")=="beet-box-bg"){
				//alert($(e.target).attr("class"));
				$(this).hide();
			}
			
		});
		
		$(".game-btn2 .ul-li a").live("click",function(){
			//alert(6);
			$('.beet-box-bg').hide();
		});
		
		
		$("#reveal-left").click(function(){
			window.location.href="/index.php";
		});
		
		
		$("#touzhuBox .danwei label>input[type='radio']").live("click",function(){
			$("#touzhuBox .danwei label").removeClass("checked22");
			$(this).parent("label").addClass("checked22");
		});
		
		$("#wei-shu label>input[type='checkbox']").live("click",function(){
			$(this).parent("label").toggleClass("checked23");
		});
		
		

	});
	
	
	function hideDOM(){
		$('.beet-box-bg').hide();
	}
	
	
	function domAction(){
		
		//节点操作
		$(".num-table .pp .title").wrap("<div class=\"lot-number-left\"></div>");
		$(".num-table .pp>input.code").wrap("<div class=\"specific-cell-o\"></div>");
		
		$(".num-table .pp").wrapInner("<div class=\"lot-number-right\"></div>");
		var _titDom;
		$(".num-table .pp .lot-number-right").each(function(){
			//$(".num-table .pp .specific-cell-o").wrapAll("<div class=\"lot-number-right\"></div>");
			
				$(this).find(".clearfix").remove();
				_titDom = $(this).children(".lot-number-left:first");
				_titDom.remove();
				//alert(_titDom);
				$(this).before(_titDom);
				
			if($(this).prev(".lot-number-left").text()==""){
				$(this).css("width","100%");
			}
			
			
		});
		

		
	}
</script>


